home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 109
/
Vol 109.iso
/
games
/
flash_ch.swf
/
scripts
/
frame_8
/
DoAction.as
Wrap
Text File
|
2008-11-12
|
639b
|
32 lines
computerScore = 0;
INFINITY = 10000000;
s = getTimer();
trace("my turn");
alpha = - INFINITY;
beta = INFINITY;
bestMove = null;
bestScore = - INFINITY;
allPossibleMoves = new Array();
capturedPiece = null;
moveScore;
compMoves;
side = SIDE_COMPUTER;
depth = MAXDEPTH;
var i = 0;
while(i < 8)
{
var j = 0;
while(j < 8)
{
if((chessBoard[i][j] & 1) == side && chessBoard[i][j] != VOID)
{
compMoves = calculateMoves(i,j,side);
allPossibleMoves = allPossibleMoves.concat(compMoves);
}
j++;
}
i++;
}
allPossibleMoves = shuffle(allPossibleMoves);
index = 0;